﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;

namespace Linxiao.SP.Tools.GroupUsersMover.Library
{
    public class Utility
    {
        /// <summary>
        /// Check if the current user is permitted to move users/groups
        /// </summary>
        /// <param name="spWeb"></param>
        /// <returns></returns>
        public static bool IsCurrentUserAuthorised(SPWeb spWeb)
        {
            return spWeb.DoesUserHavePermissions(SPBasePermissions.CreateGroups) && spWeb.DoesUserHavePermissions(SPBasePermissions.ManagePermissions);
        }
    }
}
